package com.hmall.feign.client;

import com.hmall.feign.pojo.Address;
import com.hmall.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Description: 声明式对User-Service发起的Http协议调用(OpenFeign)
 * @Date: 2023/2/20 11:08
 */
@FeignClient("userservice")
public interface UserClient {

    /**
     * Get协议的查找用户接口
     * @param id    用户ID
     * @return      用户信息
     */
    @GetMapping("/user/{id}")
    User findById(@PathVariable("id") Long id);



    /**
     * Get协议的查找用户地址接口
     * @param id    地址唯一id1
     * @return      用户地址信息
     */
    @GetMapping("/address/{id}")
    Address findAddressById(@PathVariable("id") Long id);


}
